A user interface is that by which a computer user interacts with a computer and its various programs called applications. A nearly universal format of user interface for personal computer systems and personal digital assistants (PDAs) is a visual interface—called a graphical user interface: GUI (pronounced goo' eee). Other user interfaces may be tactile or may be aural. Typically with graphical user interfaces, the user controls a graphical pointer such as a mouse, a track ball, a glidepad, or stylus to interact with a display of a graphical user interface. Depending upon the actions allowed by the application or operating system software, the user can select a feature of the graphical display such as an icon or an entry field by positioning the graphical pointer over the feature and making a selection utilizing the graphical pointing device. These features have come to be called widgets.
The actions available to a user following selection of a widget can depend upon a number of factors including the type of widget that was selected and the order of the selection in the current interaction scenario. For example, if the user selects a icon on the desktop or within a window with a single click of a mouse button, the user can typically relocate the icon within the graphical display utilizing the well-known drag-and-drop technique. Alternatively, if the selected widget is a menu bar choice, a dropdown menu may be displayed permitting the user to make a single selection from among the choices listing in the dropdown menu. In response to either the selection of a point outside of the dropdown menu indicating that the user does not wish to select any choice listed in the dropdown menu or the selection of a dropdown menu choice, the dropdown menu closes automatically.
Object-oriented programming (OOP) is becoming the normative computer programming paradigm because it allows programmers to approach their programming tasks more intuitively by using objects rather than procedures as the fundamental building blocks for creating computer programs. Objects are small reusable sections of program code that can be quickly and easily combined to create new and many different applications across a network irrespective of the computer processor's architecture and/or operating system. Conceptually, an object is an entity that is able to save information, referred to as its state, and offers a number of behaviors or functions to either examine or affect this state. An object may model the attributes or characteristics of the real-world object and, in many cases, may also model its behavior. For example, an OOP employee object may have certain attributes of a real employee, such as a name, an address, and an employee number, etc. and could respond as a real employee such that the employee object could provide the employee's address when asked for that information or provide the employee's status, e.g., “on vacation,” when asked for status information. Another example maybe a calendar object which may be used in several applications such as a scheduling application, a presentation application, and/or a data base application to calculate employee's vacation and pay, etc.
A fundamental concept in OOP is the class. A class is a template or prototype that defines a type of object and specifies the attributes and methods associated with objects or members of the class. Objects of the same class have the same definition for their operations and information structures. An object is created or instantiated at runtime, i.e., when the computer executes a statement in the program.
Encapsulation, inheritance and polymorphism are three important concepts that further differentiate OOP from procedural programming. Encapsulation means keeping the data structure and the methods/functions that process the data together in the same class. Inheritance is the ability to derive a new class from one or more existing classes. The new class, known as a subclass, inherits or incorporates all properties of a parent class including its attributes and its methods. The new class or subclass may be further defined to include additional properties. An example of inheritance might be that a new class square inherits all the attributes and methods of objects in the class rectangle, but the new class square can be modified so that the methods to calculate area or perimeter can be particularized using polymorphism. Polymorphism is that concept of OOP that allows the same name to be used in a parent class and an inherited or subclass but the subclass may provide a different version of a method with the same name the exists in the base class, such as calculation of the area of a square.
Often when writing graphical user interfaces for applications or application development tools, the user is prompted for a special kind of input. This special input may be a predefined value or a user-specified value. Designing a user interface for these special inputs requires special considerations. There needs to be an entry field to allow the user to enter a specific local value, such as a port number, userid or owner name. That entry field, moreover, should be disabled unless the user enters a value other than the inherited or special value.
Graphical user interfaces have presented options to enter predefined and user input data in several ways. A typical option for input on a graphical user interface is a checkbox. A checkbox with a label such as “Use default value” may be combined with an entry field. The programmer listens for that checkbox to be selected and, when selected, toggles the entry field between read-only, i.e., read the value in the checkbox, and write-capable, i.e., read that value entered by the user. In the case of the checkbox, the programmer has to toggle the contents of the entry field between the special value and the last-user-entered value. The disadvantage of the checkbox is that it requires additional programming effort, and more user-interface real estate is required to show both the checkbox and the entry field.
Another option is to use a combination input field known as an editable dropdown, which is an entry field where the user can type in a value or activate a dropdown list containing only one entry—the special value. When selected, the special value from the list replaces the contents of the entry field. The user then can either type a local value into the entry field or select the special value from the dropdown list. The dropdown list requires additional programming effort. The programmer has to disable error checking when the special value is selected and reenable error checking when the user starts typing. From the user point of view, this is not an intuitive use of dropdown list boxes, as these are typically used for a multiple selection design pattern, not a binary decision design pattern. The user expects to see multiple values in a list box, not a single value.
There are additional problems associated with both the checkbox and the dropdown approach. The checkbox approach requires a lot of real estate to visually show both the button with its label text, and the entry field. The dropdown list is difficult if the special value is a different data type than what the user is allowed to specify. For example, with a port number, the user entry will be restricted to numbers. Yet the special value “first available” is not a number, it is a string. Placing that string in the entry field of a dropdown list causes the error-checking code to flag it as invalid because it is not a positive integer value. Special case coding thus is required every time the case changes which becomes tricky for the programmer, especially if the special value string is translated into multiple languages. Furthermore, using a full-function dropdown to list a single choice is overkill for the problem. Typically dropdown lists contain multiple values from which to choose.
Just the fact there are multiple approaches to this common design problem indicates the need for a user interface widget designed and optimized for binary decision making wherein the decision may involve different data types. If used consistently, then user quickly learns that he is being asked to make a binary decision between a special value and user-entered value of his choice. This makes the product more usable and is less confusing to the user.